<template>
  <div class="food-add" >
      <div class="left">
           <van-checkbox v-show="isCheck" checked-color="#ffc400" :name="item.id" class="checkbox"></van-checkbox>
           <img :src="item.pic" alt="这是一张照片">
         <div class="text">
            <div class="title">{{item.title}}</div>
            <div class="add_btn">
                <van-icon name="add-o"  class="icon" v-if="item.add" @click="addClick(item.id)"/>
                <van-stepper :value="item.num" v-else :min="0" :name="item.id" @change="NumChange"/>
            </div>
          </div>
      </div>
      <div class="right">
            <div class="price">￥{{item.price}}</div>
      </div>
  </div>
</template>

<script>
export default {
  name:'FoodList',
  props:['item','addClick','NumChange','isCheck','choseOne',],
}
</script>

<style lang="less" scoped>
.food-add{
    display: flex;
    justify-content: space-between;
    padding: 10px;
    .left{
        display: flex;
        flex: 1;
        img{
            width: 60px;
            height: 60px;
            border-radius: 10px;
            margin-left: 8px;
        }
        .text{
            display: flex;
            flex: 1;
            height: 100%;
            margin-left:15px;
            flex-direction: column;
            justify-content: space-between;
            align-items: flex-start;
            position: relative;
            .title{
                font-size: 16px;
            }
            .add_btn{
                 .icon{
                     position: absolute;
                     right: 10px;
                     bottom: 3px;
                     font-size: 20px;
                     color: red;
                 }
            }
        }
    }
    .right{
        text-align: right;
        font-size: 16px;
        font-weight: 700;
}
}
</style>